home *** CD-ROM | disk | FTP | other *** search
- scrolling = function()
- {
- var _loc5_ = scrollTrack._height;
- var _loc2_ = contentMain._height + 20;
- var _loc4_ = scrollFace._height;
- var _loc3_ = maskedView._height;
- var initPosition = scrollFace._y = scrollTrack._y;
- var initContentPos = contentMain._y + 5;
- var finalContentPos = _loc3_ - _loc2_ + initContentPos;
- var left = scrollTrack._x;
- var top = scrollTrack._y;
- var right = scrollTrack._x;
- var bottom = scrollTrack._height - _loc4_ + scrollTrack._y;
- var dy = 0;
- var speed = 10;
- var moveVal = (_loc2_ - _loc3_) / (_loc5_ - _loc4_);
- scrollFace.onPress = function()
- {
- var _loc2_ = this._y;
- startDrag(this,0,left,top,right,bottom);
- this.onMouseMove = function()
- {
- dy = Math.abs(initPosition - this._y);
- contentMain._y = Math.round(dy * -1 * moveVal + initContentPos);
- };
- };
- scrollFace.onMouseUp = function()
- {
- stopDrag();
- delete this.onMouseMove;
- };
- btnUp.onPress = function()
- {
- this.onEnterFrame = function()
- {
- if(contentMain._y + speed < maskedView._y)
- {
- if(scrollFace._y <= top)
- {
- scrollFace._y = top;
- }
- else
- {
- scrollFace._y -= speed / moveVal;
- }
- contentMain._y += speed;
- }
- else
- {
- scrollFace._y = top;
- contentMain._y = maskedView._y;
- delete this.onEnterFrame;
- }
- };
- };
- btnUp.onDragOut = function()
- {
- delete this.onEnterFrame;
- };
- btnUp.onRollOut = function()
- {
- delete this.onEnterFrame;
- };
- btnUp.onRelease = function()
- {
- delete this.onEnterFrame;
- };
- btnDown.onPress = function()
- {
- this.onEnterFrame = function()
- {
- if(contentMain._y - speed > finalContentPos)
- {
- if(scrollFace._y >= bottom)
- {
- scrollFace._y = bottom;
- }
- else
- {
- scrollFace._y += speed / moveVal;
- }
- contentMain._y -= speed;
- }
- else
- {
- scrollFace._y = bottom;
- contentMain._y = finalContentPos;
- delete this.onEnterFrame;
- }
- };
- };
- btnDown.onRelease = function()
- {
- delete this.onEnterFrame;
- };
- btnDown.onDragOut = function()
- {
- delete this.onEnterFrame;
- };
- btnDown.onRollOut = function()
- {
- delete this.onEnterFrame;
- };
- if(_loc2_ < _loc3_)
- {
- scrollFace._visible = false;
- btnUp.enabled = false;
- btnDown.enabled = false;
- }
- else
- {
- scrollFace._visible = true;
- btnUp.enabled = true;
- btnDown.enabled = true;
- }
- };
- scrolling();
- stop();
-